const sequelize = require('../config/connect.js')//引入数据库连接文件
const config = require('../config/config.js')//引入数据库配置文件
const { Op, Model, DataTypes } = require('sequelize')//引入nodejs的orm模型文件

class vipLevel extends Model{}  //会员信息表

vipLevel.init({
    level:{
        type:DataTypes.SMALLINT,
        primaryKey:true,
        comment:'会员等级'
    },
    discount:{
        type:DataTypes.DECIMAL(10,2),
        allowNull:true,
        comment:'享受折扣'
    },
    totalAmount:{
        type:DataTypes.BIGINT,
        allowNull:true,
        comment:'会员等级对应消费金额'
    },
    remarks:{
        type:DataTypes.STRING(32),
        allowNull:true,
        comment:'备注'
    }
},{
    charset:config.charset,
    sequelize,
    timestamps:false,
    freezeTableName:true,
    modelName:'vipLevel'
})

module.exports = vipLevel;